import { ref } from 'vue'
import { defineStore } from 'pinia'
import getCategoryAPI from '@/apis/layout';
const useCategory = defineStore('category', () => {
    // 渲染数据
    //state 导航列表数据
    const getCategoryList = ref([]);
    
    //action 获取导航数据方法
    const getCategory = async () => {
        //发送网络请求
        const res = await getCategoryAPI();
        getCategoryList.value = res.result;
    };
    return {
        getCategoryList,
        getCategory
    }
})

export default useCategory
